/*
 * Simulation.h
 *
 *  Created on: Jan 23, 2011
 *      Author: Helpful Learn Group
 */

#ifndef SIMULATION_H_
#define SIMULATION_H_

/*
 *
 */

#include "Circle.h"

//FORWARD DECLARATION...
//class Circle;

namespace GSP280
{
	class Simulation
	{
	private:
		float initOmega;			//initial omega from user input
		int initRadius;				//initial radius from user input

		int mass;					//mass of launching obj
		int radius; 				//radius of catapult
		float omega; 				//angular velocity
		float angle;				//angle of launching obj
		Circle launchObj;
		Circle targetObj;

		//INTERNAL TRACKING ONLY...
		int counter;				// track the number of simulated loops

		float angMomentum;
		float Vt;					//track Tangential Velocity
		float Vx;					//track Initial Velocity in X-axis
		float Vy;					//track Initial Velocity in Y-axis
		float totalTime;			//track Total Time of flight
		float projectileHeight;		//track Max Projectile Height
		float projectileRange;		//track Range/Distance of projectile

		//INTERNAL CALCULATING METHODS...
		const float calc_AngularMomentum ( ) const;		//M001:
		const float calc_TangentialVelocity ( ) const;	//M002:
		const float calc_Vx() const;					//M003:
		const float calc_Vy() const;					//M004:
		const float calc_TotalTime() const;				//M005:
		const float calc_ProjectileHeight ( );			//M006:
		const float calc_ProjectileRange ( );			//M007:
		const Vector2 calc_FlyingObj_NewLocation(); 	//M008: use this method ONLY if M007 output >= (targetObj.X )
		void calc_NewAngularVelocity();					//M009: calculate new angular momentum
		void calc_Simulation();							//M010: Gets called repeatedly until a successful collision has been detected
		void SimLoop();									//M011: Continue to run and loop until a collision is detected

	public:
		//Simulation ();
		//virtual ~Simulation ( );

		void Start ( const int &mass, const int &radius, const float &omega,
				const float &angle, const Vector2 &vecLaunch, const Vector2 &vecTarget );

		void display ( );
	};

}

#endif /* SIMULATION_H_ */
